import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Reg from '../pages/Reg.vue'
import Login from '../pages/Login.vue'
import Manage from '../pages/Manage.vue'
// import Student from '../pages/student/index.vue'
// import Classz from '../pages/class/index.vue'
// import Teacher from '../pages/teacher/index.vue'
// import Test from '../pages/Test.vue'
import User from '../pages/user/index.vue';
import Role from '../pages/role/index.vue';
import SellTotal from '../pages/total/SellTotal.vue';
import MonthSellTotal from '../pages/total/MonthSellTotal.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/test',
    //   name: 'test',
    //   component: Test
    // },
    {
      path: '/reg',
      name: 'reg',
      component: Reg
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/manage',
      name: 'manage',
      component: Manage,
      children:[
        // {
        //   path: 'student',
        //   name: 'student',
        //   component: Student
        // },
        // {
        //   path: 'class',
        //   name: 'class',
        //   component: Classz
        // },
        // {
        //   path: 'teacher',
        //   name: 'teacher',
        //   component: Teacher
        // }
        {
          path: 'user',
          name: 'user',
          component: User
        },
        {
          path: 'role',
          name: 'role',
          component: Role
        },{
          path: 'sellTotal',
          name: 'sellTotal',
          component: SellTotal
        },{
          path: 'monthSellTotal',
          name: 'monthSellTotal',
          component: MonthSellTotal
        }
      ]
    },
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    }
  ]
})

export default router
